{% extends 'index.html' %}
{% block page-content %}
<div id="page-wrapper">
    <div class="row">
         <div class="col-lg-12">
              <h1 class="page-header"><i class="fa  fa-print "></i>Ansible操作日志</h1>
         </div>
                <!-- /.col-lg-12 -->
    </div>
	<div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                           	<i class="fa   fa-gear"></i> 操作日志
                        </div>
                        <div class="panel-body">

				                            
				           <ul class="nav nav-tabs">
				              <li class="active"><a href="#model" data-toggle="tab"><i class="fa fa-cubes"></i> Ansible模块</a>
				              </li>					           
				              <li><a href="#profile" data-toggle="tab"><i class="fa fa-tasks"></i> 剧本日志</a>
				              </li>
			              
				           </ul>
				
				                            
				           <div class="tab-content">
				              <div class="tab-pane fade in active" id="model">
				                   <div class="row">
				                   		<div class="col-lg-12">
				                   			<br>
				                            <table width="100%" class="table table-striped table-bordered table-hover" id="modelTableList">
				                                <thead>
				                                    <tr>
				                                    	<th class="text-center">#</th>
				                                    	<th class="text-center">操作用户</th>
				                                        <th class="text-center">模块名称</th>
				                                        <th class="text-center">模块参数</th>
				                                        <th class="text-center">服务器</th>
				                                        <th class="text-center">操作时间</th>
				                                    </tr>
				                                </thead>
				                                <tbody>
				                                	{% for ds in modelList %}
				                                		<tr class="odd gradeX">
				                                			<td class="text-center">
				                                				 {{ forloop.counter }}
				                                			</td>
				                                			<td class="text-center">{{ds.ans_user}} </td>
				                                			<td class="text-center">{{ds.ans_model}} </td>
				                                			<td class="text-center">{{ds.ans_args}} </td>
				                                			<td class="text-center">{{ds.ans_server}} </td>
				                                			<td class="text-center">{{ds.create_time|date:"Y/m/d H:i  "}} </td>
				                                		</tr>
				                                	{% endfor %}
				                                </tbody>
				                            </table>			                   			
										</div>
				                   </div>
				              </div>				           
				              <div class="tab-pane fade" id="profile">
				                   <div class="row">
				                   		<div class="col-lg-12">
				                   			<br>
				                            <table width="100%" class="table table-striped table-bordered table-hover" id="playbookTableList">
				                                <thead>
				                                    <tr>
				                                    	<th class="text-center">任务id</th>
				                                    	<th class="text-center">操作用户</th>
				                                        <th class="text-center">剧本名称</th>
				                                        <th class="text-center">剧本内容</th>
				                                        <th class="text-center">服务器</th>
				                                        <th class="text-center">操作时间</th>
				                                    </tr>
				                                </thead>
				                                <tbody>
				                                	{% for ds in playbookList %}
				                                		<tr class="odd gradeX">
				                                			<td class="text-center">
				                                				 <a href="/apps/playbook/modf/{{ds.cron_id}}/">{{ds.ans_id}}</a>
				                                			</td>
				                                			<td class="text-center">{{ds.ans_user}} </td>
				                                			<td class="text-center">{{ds.ans_name}} </td>
				                                			<td class="text-center">{{ds.ans_content}} </td>
				                                			<td class="text-center">{{ds.ans_server}} </td>
				                                			<td class="text-center">{{ds.create_time|date:"Y/m/d H:i  "}} </td>
				                                		</tr>
				                                	{% endfor %}
				                                </tbody>
				                            </table>			                   			
										</div>
				                   </div>
				              </div>
				              
				           </div>


                            <!-- /.row (nested) -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>    
</div>


<script type="text/javascript">

		$(document).ready(function() {
		    $('#playbookTableList').DataTable({
		        responsive: true
		    });
		});

		$(document).ready(function() {
		    $('#modelTableList').DataTable({
		        responsive: true
		    });
		});
				
  
</script>

{% endblock %}